@if (Model.ToString().EndsWith("PostModel"))
{
    var request = Url.ActionContext.HttpContext.Request;
    var absoluteUrl = $"{request.Scheme}://{request.Host.ToUriComponent()}{request.PathBase.ToUriComponent()}";
    PostModel postModel = (PostModel)Model;
    var postTitle = postModel.Post.Title;
    var postDesc = postModel.Post.Description.StripHtml();
    var postUrl = postModel.Post.PostType == PostType.Post ? absoluteUrl + "/posts/" + postModel.Post.Slug : absoluteUrl + "/" + postModel.Post.Slug;
    var postCover = absoluteUrl + "/" + postModel.Post.Cover;
    var postPublished = postModel.Post.Published.ToString("s");
    var postAuthor = postModel.Post.Author.DisplayName;

    <script type="application/ld+json">
      {
      "@@context": "https://schema.org",
      "@@type": "NewsArticle",
      "headline": "@postTitle",
      "url": "@postUrl",
      "articleBody": "@postDesc",
      "image": "@postCover",
      "datePublished": "@postPublished",
      "dateModified": "@postPublished",
       "author": {
        "@@type": "Person",
        "name": "@postAuthor"
      }
    }
    </script>
}
